All Packages Class Hierarchy This Package Previous Next Index
Class sun.server.util.List
java.lang.Object
|
+----sun.server.util.List
- public class List
- extends Object
A class that defines the list data structure.
-
List()
-
-
List(int)
-
-
delete(Object)
- delete is used to delete an element from the middle of the list.
-
deleteAll()
- Delete all elements of the list.
-
deleteHead()
- Delete the head of the list.
-
deleteListEntry(ListEntry)
- The deleteListEntry method is a fast way to delete objects
from the middle of the list.
-
deleteTail()
- Delete the tail of the list.
-
elements()
- Return a list of elements that are on the list.
-
firstElement()
- Return the first element of the list.
-
insertHead(Object)
- Add an element to the head of the list.
-
insertTail(Object)
- Add an element to the tail of the list.
-
lastElement()
- Return the last element of the list.
-
makeFirst(ListEntry)
- Move the specified ListEntry
as the head of the list.
-
makeLast(ListEntry)
- Move the specified ListEntry
as the tail of the list.
-
size()
- Return the number of elements of the list.
List
public List()
List
public List(int count)
firstElement
public synchronized Object firstElement()
- Return the first element of the list. The list is
not changed as a result of this operation
lastElement
public synchronized Object lastElement()
- Return the last element of the list. The list is
not changed as a result of this operation
insertHead
public synchronized ListEntry insertHead(Object element)
- Add an element to the head of the list.
- Returns:
- a ListEntry object that can be later used to
delete the just inserted object. This is not
the same as the object inserted and is used
in the deleteListEntry() method. This is used for
a pure performance optimisation - delete()
is an o(N) operation and deleteListEntry is o(1).
- See Also:
- deleteListEntry
insertTail
public synchronized ListEntry insertTail(Object element)
- Add an element to the tail of the list.
- Returns:
- a ListEntry object that can be later used to
delete the just inserted object. This is not
the same as the object inserted and is used
in the deleteListEntry() method. This is used for
a pure performance optimisation - delete()
is an o(N) operation and deleteListEntry is o(1).
- See Also:
- deleteListEntry
delete
public synchronized Object delete(Object element)
- delete is used to delete an element from the middle of the list.
This operation takes o(N) time. For faster deletes, deleteListEntry
can be used.
- Parameters:
- the - element to be deleted.
- Returns:
- the element just deleted or null if the
element to be deleted is not part of the list.
- See Also:
- deleteListEntry
deleteListEntry
public synchronized Object deleteListEntry(ListEntry entry)
- The deleteListEntry method is a fast way to delete objects
from the middle of the list. For deleting from the head or
tail of the list deleteHead or deleteTail can be used. The ListEntry
is an opaque object returned by insertHead() or insertTail().
The deleteListEntry() is a fast way of deleting objects directly
in the middle of the list without having to traverse the list.
deleteListEntry() is a o(1) operation while delete() is a o(N)
operation. So the application could save the ListEntry object returned by
inserts for faster deletion from the middle of the list.
The deleteHead() and deleteTail() methods
are o(1) operations as well.
- Parameters:
- the - ListEntry object returned by insertHead or insertTail
- Returns:
- the deleted object from the list.
deleteHead
public synchronized Object deleteHead()
- Delete the head of the list.
- Returns:
- the element just deleted or null if the list is empty.
deleteTail
public synchronized Object deleteTail()
- Delete the tail of the list.
- Returns:
- the element just deleted or null if the list is empty.
deleteAll
public synchronized void deleteAll()
- Delete all elements of the list.
makeFirst
public synchronized void makeFirst(ListEntry entry)
- Move the specified ListEntry
as the head of the list.
makeLast
public synchronized void makeLast(ListEntry entry)
- Move the specified ListEntry
as the tail of the list.
elements
public synchronized Enumeration elements()
- Return a list of elements that are on the list.
size
public synchronized int size()
- Return the number of elements of the list.
All Packages Class Hierarchy This Package Previous Next Index